<div id="content">
	<%= render 'administrator/tabs' %>
</div>
<h2>Search entries</h2>
<div class="form-search">
	<%= render 'search' %>
</div>
<h2>Listing entries</h2>
<table class="scaffold-table">
	<tr>
		<th>NO.</th>
		<th>Login</th>
		<th>Action</th>
		<th>Result</th>
		<th>IP</th>
		<th>Date/Time</th>
		<th>View</th>
		<th>Edit</th>
		<th>Delete</th>
	</tr>
	<% @entries.each_with_index do |entry,index| %>
	<tr>
		<td><%= index+1 %></td>
		<td><%= entry.login %></td>
		<td><%= entry.action %></td>
		<td><%= entry.result %></td>
		<td><%= entry.ip %></td>
		<td><%= entry.created_at %></td>
		<td class="command"> <% if can? :read, Entry %>
		<%= link_to image_tag("view-icon.png", :border => 0) , entry  %>
		<% else %>
		-
		<% end %> </td>
		<td class="command"> <% if can? :update, Entry %>
		<%= link_to image_tag("edit-icon.png", :border => 0) , edit_entry_path(entry)  %>
		<% else %>
		-
		<% end %> </td>
		<td class="command"> <% if can? :destroy, Entry %>
		<%= link_to image_tag("delete-icon.png", :border => 0) , entry , :confirm => 'Are you sure?', :method => :delete %>
		<% else %>
		-
		<% end %> </td>
	</tr>
	<% end %>
</table>
<%= will_paginate @entries %>
<% if can? :create , Entry %>
<%= link_to image_tag("add-icon.png", :border => 0) , new_entry_path , {:class => 'form-command'} %>
<%= link_to 'New Entry', new_entry_path %>
<% end %> 